Date: Mon, 11 Nov 1996 21:42:14 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Tue, 29 Oct 1996 14:24:33 GMT
Content-length: 4037

<html>
<head>
<title> Program 0 </title>
</head>

<body>
<center> <h2> Program 0 </h2> </center>

<p> CS110 Section 8
<br> TA: Michael Birk
<br> <strong> Assigned: </strong> Tue 9/29/96
<br> <strong> Due: </strong> Tue 10/5/96

<p> Program 0 is designed to provide experience with the lab machines, the
software we will be using, and the handin process.  You are <em>not</em>
expected to write any C++ code on your own or understand the given code in
any way.

<p> This assignment does require, however, minimal working knowledge
of Microsoft Windows.  If you are unfamiliar with Windows and don't want
to "jump right in," then check out the
<!WA0><!WA0><!WA0><a href="http://www.cs.wisc.edu/~cs302/C++/Introduction/MSwindows.html">
Introduction to Microsoft Windows</A>.

<p> <strong>Note:</strong> If you have difficulty at any point during
this assignment, do not hesitate to ask the on-duty lab consultants for
assistance.  That's what they're there for, and they need something to
keep them busy during this first week. :-)

<h3> What to Do </h3>

<p> First, you must go to the lab in 1350 Comp Sci & St and log in.  Of
course, since you're reading this now, you've probably gotten that far
already!  After logging in, run Borland C++ by double-clicking on its icon.
Since you will be starting a new program, choose "File" and then "New" from
the menu.  This will bring up a blank editing window for you to enter your
program.

<p> Now you are ready to type in the <em>source code</em> for Program 0. The source code is
found on page 21 of the Savitch text book.  (In case you didn't bring your book, click <!WA1><!WA1><!WA1><a
href="http://www.cs.wisc.edu/~mbirk/cs110/assignments/prog0.cpp">here</a> to see the source code.) Type this program in exactly as it is
written.  Now, so that you know which program is yours when you print it out, add a
<em>comment</em> (a line beginning with two slashes) at the top of your program with your name
and other information.  For instance, the top few lines of your program might look something
like this: 

<pre>
// John Q. Doe   CS110 Section 7
// Program 0: Sample C++ Program
</pre>

<p> After you have entered the source code, give you program a name by
choosing "File" and then "Save as" from the menu.  (Initially your program
will have the rather mundane title of "noname00.cpp".)  In the window that
pops up, type <strong>prog0</strong>.  This will save your source code in
a file named "prog0.cpp" (Borland C++ automatically adds the ".cpp" suffix,
which stands for "C-plus-plus.")

<p> Now, <em>compile</em> and <em>run</em> the program by clicking on the small "lightning
bolt" icon (or choose "Debug" and then "Run" from the menu).  This will bring up yet another
window, which asks you to enter the number of "pods" and "peas in a pod," then calculates and
prints the number of "peas in all."  Afther this, the window becomes "inactive," meaning the
program has finished and you should close the window by double-clicking on the box in the
upper-left corner.

<p> If, when trying to run your program, you get "errors" instead of a blank
window, this means that you made a typo when entering the source code.  Find
the typo and fix it, and then try running the program again. The <em>line
number</em> of the error message may give an indication of where the typo
is.

<p> Try running the program a few times, entering different numbers. After
you've tested the program and are certain it is working, <em>print</em> a
hard copy by selecting "File" and then "Print" from the menu.  Click "OK" on
the window which pops up.  This printout will show up on one of the laser
printers in room 1359.  (Unfortunately, there is no simple way to know which
of the four printers it will be on.)

<p> That's it!  Hang on to the printout, and hand it in at the beginning of
class on the due date.  You can now exit Borland C++ by choosing "File" and
then "Exit" from the menu.  To log out of the system, choose "File" and then
"Exit Windows" from the Program Manager window.

<hr>
<address> <!WA2><!WA2><!WA2><a href="mailto:mbirk@cs.wisc.edu">mbirk@cs.wisc.edu</a> </address>

</body>
</html>
